//
//  YTPasswordInputView.h
//  YTPasswordInput
//
//  Created by 拓客营 on 2022/4/15.
//  Copyright © 2022 小焘无量. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class YTPasswordInputView;

@protocol  YTPasswordInputViewDelegate<NSObject>

@optional

/**输入改变*/
- (void)passwordInputViewDidChange:(YTPasswordInputView *)passwordInputView;

/**点击删除*/
- (void)passwordInputViewDidDeleteBackward:(YTPasswordInputView *)passwordInputView;

/**输入完成*/
- (void)passwordInputViewCompleteInput:(YTPasswordInputView *)passwordInputView;

/**开始输入*/
- (void)passwordInputViewBeginInput:(YTPasswordInputView *)passwordInputView;

/**结束输入*/
- (void)passwordInputViewEndInput:(YTPasswordInputView *)passwordInputView;

@end

@interface YTPasswordInputViewConfigure : NSObject

/**是否显示密码： 默认显示*/
@property (nonatomic, assign) BOOL isShow;
/**密码的位数*/
@property (nonatomic, assign) NSUInteger passwordNum;
/**边框正方形的大小*/
@property (nonatomic, assign) CGFloat squareWidth;
/**黑点的半径*/
@property (nonatomic, assign) CGFloat pointRadius;
/**边距相对中间间隙倍数*/
@property (nonatomic, assign) CGFloat spaceMultiple;
/**黑点颜色*/
@property (nonatomic, strong) UIColor *pointColor;
/**边框颜色*/
@property (nonatomic, strong) UIColor *rectColor;
/**输入框背景颜色*/
@property (nonatomic, strong) UIColor *rectBackgroundColor;
/**控件背景颜色*/
@property (nonatomic, strong) UIColor *backgroundColor;
/**字体颜色*/
@property (nonatomic, strong) UIColor *textColor;
/**字体*/
@property (nonatomic, strong) UIFont *font;
/**是否允许三方键盘，默认NO*/
@property (nonatomic, assign) BOOL threePartyKeyboard;

@end


@interface YTPasswordInputView : UIView
<UIKeyInput>

///代理
@property (nonatomic, weak) id<YTPasswordInputViewDelegate> delegate;

///输入的文本
@property (nonatomic, strong, readonly) NSMutableString *text;

///更新配置
- (void)updateWithConfigure:(void(^)(YTPasswordInputViewConfigure *configure))configBlock;

///清除文字
- (void)clearText;

@end
NS_ASSUME_NONNULL_END
